package business.impl;

import java.sql.ResultSet;
import java.util.List;








import model.AnnexB;
import model.TPractice;
import model.TProper;
import model.VProexper;
import business.basic.iHibBaseDAO;
import business.basic.iHibBaseDAOImpl;
import business.dao.ProexpDao;

public class ProexpDaoImpl implements ProexpDao {
	
	iHibBaseDAO bdao = null;
	public void setBdao (iHibBaseDAO bdao){
		this.bdao=bdao;
		
	}

	@Override
	public TProper getProById(int id) {
		TProper title = (TProper) bdao.findById(TProper.class,id);
		return title;
	}

	@Override
	public int addPro(TProper model) {
		Object obj = bdao.insert(model);
		if (obj == null) {
			return 0;
		}
		return 1;
	}

	@Override
	public boolean upPro(TProper model) {
		return bdao.update(model);
	}

	@Override
	public boolean delPro(int id) {
		return bdao.delete(TProper.class, id);
	}

	@Override
	public List<VProexper> getPro(int id) {
		String sql = "from VProexper where stuinfoid =   ?";
		Object[] para = {id};
		List<VProexper> modl = bdao.select(sql, para);
		return modl;
	}

}
